<template>
	<view :class="[primarySize()]">
		<view class="container">
			<view class="p30">
				<view class="post_item" v-for="(job,index) in jobs">
					<view class="flex-box">
						<view class="fwb fs36 col3 m-ellipsis pr15 maxw60">{{job.job_name}}</view>
						<view class="flex-grow-1 tr fs32 fwb col4">{{job.salary_text}}</view>
					</view>
					<view class="mt15 col6 fs24">{{job.city.name}}{{job.district?'-'+job.district.name:''}}</view>
					<view class="clearfix pt10">
						<view class="tips_item">{{job.education_level.name}}</view>
						<view class="tips_item">{{job.work_experience.name}}</view>
					</view>
					<view class="flex flex-align-end">
					  <view class="fs24 col9 flex-grow-1 pr30">应聘简历：<text class="colff7">{{job.apply_count}}</text>份  浏览量：<text class="colff7">{{job.view_count}}</text>次</view>
						<view class="btn2" @click="bindSendJob" :data-id="job.id">发送</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const app = getApp();
	export default {
		data() {
			return {
				
				receive_user_id:0,
				query: {type:0, status:1},
				array: ['全部','急招', '直招', '店铺招聘', '红包招聘'],
				show:true,
				jobs: [],
				showPromoteTip: false,
			}
		},
		onReady() {
			uni.setNavigationBarColor({
				frontColor: '#ffffff',
				backgroundColor: this.primaryColor()
			})
		},
		onLoad: function (options) {
			
		    this.receive_user_id = options.receive_user_id;
		    this.refresh();
		},
		methods: {
			refresh: function () {
			    this.$core.get({
			      url: '/xilujob.job_manage/index', data: this.query, success: ret => {
			        this.jobs = ret.data.jobs;
			      }
			    });
			},
			bindSendJob(e){
				let jobId = e.currentTarget.dataset.id;
				this.$chatIM.sendMessage(this.receive_user_id, jobId,3);
				uni.navigateBack();
			}
		}
	}
</script>

<style lang="scss" scoped>
.post {
		&_list {
			padding-top: 10rpx;
		}

		&_item {
			width: 690rpx;
			background: #FFFFFF;
			box-shadow: 0rpx 0rpx 20rpx 0rpx rgba(0, 0, 0, 0.03);
			border-radius: 18rpx;
			margin-top: 20rpx;
			padding: 30rpx;

			.maxw60 {
				max-width: 60%;
			}

			.urgent {
				width: 74rpx;
				height: 37rpx;
				line-height: 33rpx;
				text-align: center;
				font-size: 24rpx;
				color: #FF7B20;
				border-radius: 6rpx;
				border: 2rpx solid #FF7B20;
			}

			.tips_item {
				height: 32rpx;
				background: #ECEFF5;
				border-radius: 4rpx;
				font-weight: 400;
				font-size: 22rpx;
				color: #A5A5A5;
				line-height: 32rpx;
				display: inline-block;
				vertical-align: top;
				margin-right: 10rpx;
				margin-top: 10rpx;
				padding: 0 8rpx;
			}

			.cover {
				width: 40rpx;
				height: 40rpx;
				border-radius: 50%;
			}
		}
	}
	.btn2{width: 120rpx;}
	.colff7{color: var(--primary);}
</style>
